<?php

function store_entry(){
	if ($_SESSION['id']==0) {
		$id = mysql_get_newid('entry','entry_id');
		mysql_query("INSERT INTO entry VALUE('$id','{$_POST['entry-title']}','{$_POST['entry-content']}',NOW(),NOW())");
	} else {
		$id = $_SESSION['id'];
		mysql_query("UPDATE entry SET title='{$_POST['entry-title']}',content='{$_POST['entry-content']}',date_modified=NOW() WHERE entry_id='$id'");
	}	
}

function del_entry(){
	mysql_query("DELETE FROM entry WHERE entry_id='{$_SESSION['id']}'");
}

function del_user(){
	mysql_query("DELETE FROM user WHERE user_id='{$_SESSION['id']}'");
}

?>